package test;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

public class TreePanel extends Composite {

	private Tree tree = null;

	public TreePanel(Composite parent, int style) {
		super(parent, style);
		initialize();
	}

	private void initialize() {
		tree = new Tree(this, SWT.NONE);
		tree.setBounds(new Rectangle(11, 11, 280, 181));

		TreeItem root = new TreeItem(tree, 0);
		root.setText("root");
		for (int i = 0; i < 10; i++) {
			TreeItem iItem = new TreeItem(root, 0);
			iItem.setText("TreeItem (0)");
		}

		this
				.setBackground(Display.getCurrent().getSystemColor(
						SWT.COLOR_WHITE));
		this.setSize(new Point(300, 200));
		this.setLayout(null);
	}

}
